home *** CD-ROM | disk | FTP | other *** search
/ Sesame Street - Season 38 Press Kit / Sesame Street - Season 38 Press Kit CD-ROM.iso / mac.swf / scripts / frame_61 / DoAction.as
Encoding:
Text File  |  2007-06-07  |  3.8 KB  |  114 lines

  1. function buildRightWords()
  2. {
  3.    i = 0;
  4.    while(i <= leftWordArray.length - 1)
  5.    {
  6.       tg = 0.5 + i * 0.05;
  7.       var rightInit = {_rotation:9.2 * i};
  8.       var rightWords = rightWordCage.attachMovie("rightWord","rw" + i,d++,rightInit);
  9.       rightWords.art._x = 0;
  10.       rightWords.art.tween("_x",250,0.5,"easeOutBack",tg);
  11.       rightWords.art.colorTo(rightWordArray[i][1],0,"linear");
  12.       rightWords.art.createTextField("txt",d++,0,0,300,50);
  13.       rightWords.art.txt.embedFonts = true;
  14.       rightWords.art.txt.autoSize = true;
  15.       rightWords.art.txt.text = rightWordArray[i][0];
  16.       rightWords.art.txt.setTextFormat(rightFmt);
  17.       rightWords.art.btn._width = rightWords.art.txt._width;
  18.       rightWords.art.hilite1._x = rightWords.art.txt._width + 20;
  19.       rightWords.art.hilite0._alpha = 0;
  20.       rightWords.art.hilite1._alpha = 0;
  21.       rBtn = rightWords;
  22.       rBtn.num = i;
  23.       rBtn.onRollOver = function()
  24.       {
  25.          current = this.num;
  26.          checkTheCount();
  27.          this.art.hilite0._alpha = 100;
  28.          this.art.hilite1._alpha = 100;
  29.          this.art._xscale = this.art._yscale = 115;
  30.          currentMuppet = eval(rightWordArray[this.num][2]);
  31.          select();
  32.       };
  33.       rBtn.onRollOut = function()
  34.       {
  35.          current = 0;
  36.          checkTheCount();
  37.          this.art.hilite0._alpha = 0;
  38.          this.art.hilite1._alpha = 0;
  39.          this.art._xscale = this.art._yscale = 100;
  40.       };
  41.       rBtn.onRelease = rBtn.onReleaseOutside = function()
  42.       {
  43.       };
  44.       i++;
  45.    }
  46. }
  47. function buildLeftWords()
  48. {
  49.    i = 0;
  50.    while(i <= leftWordArray.length - 1)
  51.    {
  52.       tg = 0.5 + i * 0.05;
  53.       var leftInit = {_rotation:9.2 * (leftWordArray.length - i * 1)};
  54.       var leftWords = leftWordCage.attachMovie("leftWord","lw" + i,d++,leftInit);
  55.       leftWords.art.txt.text = leftWordArray[i][0];
  56.       leftWords.art.colorTo(leftWordArray[i][1],0,"linear");
  57.       leftWords.art.createTextField("txt",d++,0,0,100,50);
  58.       leftWords.art.txt.embedFonts = true;
  59.       leftWords.art.txt.autoSize = "right";
  60.       leftWords.art.txt.text = leftWordArray[i][0];
  61.       leftWords.art.txt.setTextFormat(leftFmt);
  62.       leftWords.art.btn._width = leftWords.art.txt._width;
  63.       leftWords.art.btn._x = leftWords.art.txt._x;
  64.       leftWords.art.hilite0._x = leftWords.art.txt._x - 20;
  65.       leftWords.art.hilite1._x = leftWords.art.txt._x + leftWords.art.txt._width + 20;
  66.       leftWords.art.hilite0._alpha = 0;
  67.       leftWords.art.hilite1._alpha = 0;
  68.       leftWords.art._x = 0;
  69.       leftWords.art.tween("_x",-360,0.5,"easeOutBack",tg);
  70.       lBtn = leftWords;
  71.       lBtn.num = i;
  72.       lBtn.onRollOver = function()
  73.       {
  74.          current = this.num;
  75.          this.art.hilite0._alpha = 100;
  76.          this.art.hilite1._alpha = 100;
  77.          this.art._xscale = this.art._yscale = 115;
  78.          this.art._x = -375;
  79.          currentMuppet = eval(leftWordArray[this.num][2]);
  80.          select();
  81.       };
  82.       lBtn.onRollOut = function()
  83.       {
  84.          current = 0;
  85.          this.art.hilite0._alpha = 0;
  86.          this.art.hilite1._alpha = 0;
  87.          this.art._x = -360;
  88.          this.art._xscale = this.art._yscale = 100;
  89.       };
  90.       lBtn.onRelease = lBtn.onReleaseOutside = function()
  91.       {
  92.       };
  93.       i++;
  94.    }
  95. }
  96. var rightFmt = new TextFormat();
  97. rightFmt.font = "myFont";
  98. rightFmt.size = 24;
  99. rightFmt.align = "left";
  100. this.createEmptyMovieClip("rightWordCage",d++);
  101. rightWordCage._x = 400;
  102. rightWordCage._y = 300;
  103. rightWordCage._rotation = -54;
  104. buildRightWords();
  105. var leftFmt = new TextFormat();
  106. leftFmt.font = "myFont";
  107. leftFmt.size = 24;
  108. leftFmt.align = "right";
  109. this.createEmptyMovieClip("leftWordCage",d++);
  110. leftWordCage._x = 400;
  111. leftWordCage._y = 300;
  112. leftWordCage._rotation = -54;
  113. buildLeftWords();
  114.